package demo2;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

/**
 * @auther hewenhui
 * @see <a href="hetp://www.codingmaster.com> java </a>
 */
import org.springframework.stereotype.Controller;

@Controller
public class UserController {
    private UserService userService;

    public User getUser() {
        return userService.getUser();
    }

//    @Autowired  这里不加也会默认为一个构造方法来进行注入
//    public UserController(UserService userService){
//        this.userService=userService;
//    }

//    @Autowired
    public void setUserService(UserService userService) {
        this.userService = userService;
    }
}
